package com.damoguyansi.all.format.util;

import java.util.HashMap;
import java.util.Map;

public class AsciiUtil {
    private static Map<Integer, String> map = new HashMap<Integer, String>();

    static {
        map.put(0, "NUL(null)空字符");
        map.put(1, "SOH(start of headling)标题开始");
        map.put(2, "STX (start of text)正文开始");
        map.put(3, "ETX (end of text)正文结束");
        map.put(4, "EOT (end of transmission)传输结束");
        map.put(5, "ENQ (enquiry)请求");
        map.put(6, "ACK (acknowledge)收到通知");
        map.put(7, "BEL (bell)响铃");
        map.put(8, "BS (backspace)退格");
        map.put(9, "HT (horizontal tab)水平制表符");
        map.put(10, "LF (NL line feed, new line)换行键");
        map.put(11, "VT (vertical tab)垂直制表符");
        map.put(12, "FF (NP form feed, new page)换页键");
        map.put(13, "CR (carriage return)回车键");
        map.put(14, "SO (shift out)不用切换");
        map.put(15, "SI (shift in)启用切换");
        map.put(16, "DLE (data link escape)数据链路转义");
        map.put(17, "DC1 (device control 1)设备控制1");
        map.put(18, "DC2 (device control 2)设备控制2");
        map.put(19, "DC3 (device control 3)设备控制3");
        map.put(20, "DC4 (device control 4)设备控制4");
        map.put(21, "NAK (negative acknowledge)拒绝接收");
        map.put(22, "SYN (synchronous idle)同步空闲");
        map.put(23, "ETB (end of trans. block)传输块结束");
        map.put(24, "CAN (cancel)取消");
        map.put(25, "EM (end of medium)介质中断");
        map.put(26, "SUB (substitute)替补");
        map.put(27, "ESC (escape)溢出");
        map.put(28, "FS (file separator)文件分割符");
        map.put(29, "GS (group separator)分组符");
        map.put(30, "RS (record separator)记录分离符");
        map.put(31, "US (unit separator)单元分隔符");
        map.put(32, "(space)空格");
        map.put(33, "!");
        map.put(34, "\"");
        map.put(35, "#");
        map.put(36, "$");
        map.put(37, "%");
        map.put(38, "&");
        map.put(39, "'");
        map.put(40, "(");
        map.put(41, ")");
        map.put(42, "*");
        map.put(43, "+");
        map.put(44, ",");
        map.put(45, "-");
        map.put(46, ".");
        map.put(47, "/");
        map.put(48, "0");
        map.put(49, "1");
        map.put(50, "2");
        map.put(51, "3");
        map.put(52, "4");
        map.put(53, "5");
        map.put(54, "6");
        map.put(55, "7");
        map.put(56, "8");
        map.put(57, "9");
        map.put(58, ":");
        map.put(59, ";");
        map.put(60, "<");
        map.put(61, "=");
        map.put(62, ">");
        map.put(63, "?");
        map.put(64, "@");
        map.put(65, "A");
        map.put(66, "B");
        map.put(67, "C");
        map.put(68, "D");
        map.put(69, "E");
        map.put(70, "F");
        map.put(71, "G");
        map.put(72, "H");
        map.put(73, "I");
        map.put(74, "J");
        map.put(75, "K");
        map.put(76, "L");
        map.put(77, "M");
        map.put(78, "N");
        map.put(79, "O");
        map.put(80, "P");
        map.put(81, "Q");
        map.put(82, "R");
        map.put(83, "S");
        map.put(84, "T");
        map.put(85, "U");
        map.put(86, "V");
        map.put(87, "W");
        map.put(88, "X");
        map.put(89, "Y");
        map.put(90, "Z");
        map.put(91, "[");
        map.put(92, "\\");
        map.put(93, "]");
        map.put(94, "^");
        map.put(95, "_");
        map.put(96, "`");
        map.put(97, "a");
        map.put(98, "b");
        map.put(99, "c");
        map.put(100, "d");
        map.put(101, "e");
        map.put(102, "f");
        map.put(103, "g");
        map.put(104, "h");
        map.put(105, "i");
        map.put(106, "j");
        map.put(107, "k");
        map.put(108, "l");
        map.put(109, "m");
        map.put(110, "n");
        map.put(111, "o");
        map.put(112, "p");
        map.put(113, "q");
        map.put(114, "r");
        map.put(115, "s");
        map.put(116, "t");
        map.put(117, "u");
        map.put(118, "v");
        map.put(119, "w");
        map.put(120, "x");
        map.put(121, "y");
        map.put(122, "z");
        map.put(123, "{");
        map.put(124, "|");
        map.put(125, "}");
        map.put(126, "~");
        map.put(127, "DEL (delete)删除");
    }

    public static String getAscii(int i) {
        return map.get(i);
    }
}
